# implementation of str.partition for python 2.4

def partition(s,part):
    if part not in s:
        return (s,'','')
    
    return (s[:s.index(part)],part,s[s.index(part)+len(part):])

if __name__=="__main__":
    #test python >=2.5
    assert partition('qwe','w') == 'qwe'.partition('w')
    assert partition(':q:w:e:',':') == ':q:w:e:'.partition(':')
    assert partition('qwe','q') == 'qwe'.partition('q')
    assert partition('qwe','e') == 'qwe'.partition('e')
